// Package fuel_type 模型
package fuel_type

import (
	// "gitee.com/sweetsunnyflower/carpooling-server-go/pkg/logger"
	"gitee.com/sweetsunnyflower/carpooling-server-go/app/models"
	"gitee.com/sweetsunnyflower/carpooling-server-go/pkg/database"
)

type FuelType struct {
	models.BaseModel

	Name string `gorm:"type:varchar(255)" db:"name" json:"name" form:"name"`
	models.CommonTimestampsField
}

func (fuelType *FuelType) Create() {
	database.DB.Create(&fuelType)
}

func (fuelType *FuelType) Save() (rowsAffected int64) {
	result := database.DB.Save(&fuelType)
	return result.RowsAffected
}

func (fuelType *FuelType) Delete() (rowsAffected int64) {
	result := database.DB.Delete(&fuelType)
	return result.RowsAffected
}
